package com;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-11-16
 * Time: 11:06
 */

public class Idea {
    public void say() throws InterruptedException {
        //在文件中找到指定的打开谷歌浏览器的驱动
        System.setProperty("webdriver.chrome.driver", "E:/Java/bin/chromedriver.exe");

        //创建一个驱动对象 来打开浏览器
        ChromeDriver driver = new ChromeDriver();
        //输入访问的网址

        driver.get("http://www.360doc.com/content/22/1106/08/65839416_1054770411.shtml");
        Thread.sleep(3000);
        String test = driver.findElement(By.cssSelector("#artContent > div:nth-child(2) > blockquote > p")).getText();
        System.out.println(test);
        driver.close();

    }
}
